home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_015 / okidatadump / dospecial.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  2KB  |  56 lines

  1. /* Okidata ML 92 special commands */
  2.  
  3. #include    "exec/types.h"
  4. #include    "devices/printer.h"
  5. #include    "devices/prtbase.h"
  6.  
  7. extern struct PrinterData *PD ;
  8.  
  9. DoSpecial(command,OutputBuffer,vline,currentVMI,crlfFlag,Parms)
  10. UWORD *command ;    /* command number as defined in printer.h */
  11. char OutputBuffer[] ;    /* buffer into which to return converted command */
  12. BYTE *vline ;        /* value of the current line position */
  13. BYTE *currentVMI ;    /* value of the current line spacing */
  14. BYTE *crlfFlag ;    /* setting of the add <lf> after <cr> flag */
  15. UBYTE Parms[] ;        /* parameters that came with ANSI command */
  16. {
  17.     int i, x = 0 ;
  18.     static char
  19.      initTabs[]="\033\011008,016,024,032,040,048,056,064,072\n" ;
  20.     static char
  21.      initPrinter[]="\0331\0336" ;
  22.  
  23.     if (*command == aRIN ) {
  24.         /* initialize output buffer */
  25.         for (i=0; i < 4; i++)
  26.             OutputBuffer[x++] = initPrinter[i] ;
  27.  
  28.         /* get preferences settings */
  29.         if ( (PD->pd_Preferences.PrintQuality) == DRAFT )
  30.             OutputBuffer[1] = '0' ;
  31.  
  32.         *currentVMI = 36 ; /* initially 1/6" line spacing */
  33.         if ( (PD->pd_Preferences.PrintSpacing) == EIGHT_LPI ) {
  34.             OutputBuffer[3] = '8' ;
  35.             *currentVMI = 27 ;
  36.         }
  37.  
  38.         if ( (PD->pd_Preferences.PrintPitch) == ELITE )
  39.             OutputBuffer[x++] = '\034' ;
  40.         else if ( (PD->pd_Preferences.PrintPitch) == FINE )
  41.             OutputBuffer[x++] = '\035' ;
  42. /* what else? */
  43.         *command = aTBSALL ;
  44.     }
  45.  
  46.     if (*command == aTBSALL) {
  47.         for (i=0; i < 38; i++ )
  48.             OutputBuffer[x++] = initTabs[i] ;
  49.         return(x) ;
  50.     }
  51.  
  52. /* other special functions? -> later italics in downloadable character set */
  53.  
  54.     return(0) ;
  55. }
  56.